package networking.messages.syncMessages;

import gameStates.network.IDObject;
import logic.weapons.Weapon;
import networking.messages.SimpleMessage;

public class UpgradeMessage extends SimpleMessage {
		
	private int objectID;
	private String key, value;
	private UpgradeType type;
	
	public UpgradeMessage() {
		super();
	}
	
	public UpgradeMessage(IDObject object, String key, String value) {
		this();
		this.key = key;
		this.value = value;
		
		if(object instanceof Weapon) {
			type = UpgradeType.Weapon;
			objectID = ((Weapon)object).getID();
		} else {
			type = UpgradeType.Ship;
			objectID = object.getID();
		}
	}
	
	public int getObjectID() {
		return objectID;
	}
	
	public String getKey() {
		return key;
	}
	
	public String getValue() {
		return value;
	}
	
	public UpgradeType getType() {
		return type;
	}
}